[Chapter 2] 2.12 Wildcard Operators in the LHS
Author: Bryan Costales & Eric Allman
Date: 1999-02-04T00:04:25Z

#

| Chapter 2 The sendmail.cf File |

## 2.12 Wildcard Operators in the LHS

The LHS of a rule is compared to an address or to the result of rewriting by earlier rules. The comparison is case insensitive. To illustrate, consider passing the address hat@coat.org to this LHS:

>     $* @ $+ .ORG

The $* (match zero or more) will match hat, the @ will match exactly, the $+ (match one or more) will match coat, and the .ORG will match .org despite the case difference.

Wildcard operators match as little as possible in order to make the entire LHS match. For an address like a@b@c, the LHS $*@$+ will cause the $* to match the a.

$*

  Matches zero or more tokens. Prefers zero, or the fewest possible, to satisfy an LHS match.

$+

  Matches one or more tokens. Prefers one, or the fewest possible, to satisfy an LHS match.

$-

  Matches exactly one token.

$@

  Matches exactly zero tokens.

$=

  Matches any word in a class. Words may be single-token (like coat) or multi-token (like coat.org).

$~

  Matches any single token not in a class.

2.11 Rules |  | 2.13 Positional Operators in the RHS